package com.zmn.oms.dubbo.dto.zmn.third.zhimi;

import io.swagger.annotations.ApiModel;
import lombok.Data;

import java.io.Serializable;

/**
 * @author sunlife
 * @date:2020/4/27 4:19 下午
 * description: 检验结果
 */
@Data
@ApiModel("校验结果")
public class CheckResultDRO implements Serializable {
    /**
     * 是否是有效的SN码
     */
    private Boolean isEffective;

    /**
     * 是否过期
     */
    private Boolean isNotExpired;

    /**
     * 无效信息
     */
    private String message;

    public CheckResultDRO(Boolean isEffective, Boolean isNotExpired, String message) {
        this.isEffective = isEffective;
        this.isNotExpired = isNotExpired;
        this.message = message;
    }

    public CheckResultDRO() {}

    public static CheckResultDRO success(Boolean isNotExpired) {
        return new CheckResultDRO(true, isNotExpired, "");
    }

    public static CheckResultDRO success() {
        return new CheckResultDRO(true, true, "");
    }

    public static CheckResultDRO fail(String message) {
        return new CheckResultDRO(false, false, message);
    }
}
